/*
判断鼠标从那个方向进来的
*/

import { App, VNode, } from "vue"



const panduan = (el:HTMLElement)=>{
    let status = false
    el.addEventListener("mouseenter",(m)=>{
        if(!status){
            status = true
            el.classList.add("bg-blue-200 text-blue-400")
        }
    })
    el.addEventListener("mouseleave",(m)=>{
        if(!status){
            status = true
            el.classList.add("bg-blue-200 text-blue-400")
        }
    })
}




export const zhucefocus = (app: App) => {

    app.directive('myfocus', {
        mounted(el: HTMLElement, binding: any, vnode: VNode, oldVnode: any) {
            console.log("挂载生命周期，指令focus", el, vnode)
        },
        unmounted(el: HTMLElement, binding: any, vnode: VNode, oldVnode: any) {
            console.log("卸载生命周期，指令focus", el, vnode)
        },
    })
}